<template>
	<div>
		<div class="textTile flex-h">
		
			<span class="sp1 flex1">多元智能测试</span>
			<span class="sp2"><b>{{tabNum+1}}</b><i>/88</i></span>
		</div>
		<div v-for="(item,index) in dyznData.history" :key="index">
			<div class="textQuestions" v-show="index===tabNum">
				<span>{{item.issue}}</span>
			</div>


			<div class="commonBox zyxq flex-h" v-show="index===tabNum">
				<span class="flex1 sp1" @click="clcyes(item.val1,index,item.state)">能</span>
				<span class="flex1 sp1" @click="clcno(index)">不能</span>
			</div>
		</div>


	</div>
</template>

<script>
	import ls from 'store2';
	import specIssue from '~/components/specIssue'
	import dyznData from '~/static/json/dyzncs.json'
	export default {
		props: {
			// 			message: String,
			// 			col: String
		},
		components: {
			specIssue
		},
		data() {
			return {

				tabNum: 0,
				dyznData: dyznData,
				dyznScore: [0, 0, 0, 0, 0, 0, 0, 0]
			};
		},
		computed: {

		},
		mounted: function() {
			// console.log('worthData',intelData)
		},
		methods: {
			getChildData(data) {
				this.childData = data
				console.log(this.childData)
			},
			clcyes(score, indexs, stats) {
				

				switch (stats) {
					case "A":
						this.dyznScore[0] += score
						break;
					case "B":
						this.dyznScore[1] += score
						break;
					case "C":
						console.log('I')
						this.dyznScore[2] += score
						break;
					case "D":
						console.log('E')
						this.dyznScore[3] += score
						break;
					case "E":
			
						this.dyznScore[4] += score
						break;
					case "F":
			
						this.dyznScore[5] += score
						break;
					case "G":
						console.log('A')
						this.dyznScore[6] += score
						break;
					default:
						console.log('C')
						this.dyznScore[7] += score
				}
				console.log(this.tabNum)
				if(this.tabNum ===87){
					let obj = {
						status: 4,
						worthScore: this.dyznScore
					}
					ls.set('resultPar', obj)
					this.commonJs.gosto('IndResult')	
				}else{
					this.tabNum = indexs + 1;
				}
				
				
				// 				ls.set('scoreData', this.zyxqScore)
			},
			clcno(indexs) {
				console.log(this.tabNum)
				if(this.tabNum ===87){
					let obj = {
						status: 4,
						worthScore: this.dyznScore
					}
					ls.set('resultPar',obj)
					this.commonJs.gosto('IndResult')	
				}else{
					this.tabNum = indexs + 1;
				}
			},
			
		
		}
	};
</script>


<style scoped lang="less">
	.textTile {
		padding-bottom: 0.4rem;
		height: auto;
		width: 100%;
		border-bottom: 0.01rem solid rgba(238, 238, 238, 1);
	
		.sp1 {
			font-size: 0.4rem;
			font-weight: bold;
			color: rgba(34, 34, 34, 1);
			line-height: 0.44rem;
		}
	
		.sp2 {
			b {
				font-size: 0.4rem;
				font-weight: bold;
				color: rgba(108, 191, 32, 1);
			}
	
			i {
				font-size: 0.22rem;
				font-weight: bold;
				color: rgba(187, 187, 187, 1);
				// line-height:30px;
			}
		}
	}
	.textQuestions {
		width: 100%;
		height: auto;
		padding-top: 0.3rem;

		span {
			font-size: 0.32rem;
			font-weight: bold;
			color: rgba(34, 34, 34, 1);
			line-height: 0.45rem;
		}
	}

	.titlesDrag {
		width: 100%;
		height: 0.8rem;
		margin-top: 0.5rem;

		.sp1,
		.sp2 {
			font-size: 0.26rem;
			font-weight: bold;
			box-sizing: border-box;
			height: 0.8rem;
		}

		.sp1 {
			width: 1.5rem;
			padding-top: 0.4rem;
			color: rgba(82, 196, 26, 1);

		}

		.sp2 {
			padding-top: 0.2rem;

			color: rgba(187, 187, 187, 1);

		}
	}

	.titlesDrag1 {
		height: 0.4rem;
		margin-top: 0;
		font-size: 0.3rem;

		.sp1,
		.sp2 {
			height: 0.4rem;
			padding-top: 0;
			color: rgba(187, 187, 187, 1);
		}
	}

	.commonBox {
		position: absolute;
		width: 100%;
		height: 0.9rem;
		left: 0;
		bottom: 0.4rem;
		padding: 0 0.3rem;
		box-sizing: border-box;
	}

	.zyxq {
		.sp1 {
			height: 0.9rem;
			border-radius: 0.1rem;
			border: 0.02rem solid rgba(238, 238, 238, 1);
			font-size: 0.3rem;

			font-weight: bold;
			color: rgba(34, 34, 34, 1);
			line-height: 0.9rem;
			text-align: center;
		}

		.sp3 {
			width: 6.1rem;
			height: 0.9rem;
			border-radius: 0.1rem;
			border: 0.02rem solid rgba(108, 191, 32, 1);
			margin: 0 auto;
			display: block;
			line-height: 0.9rem;
			text-align: center;
			font-size: 0.3rem;
			font-weight: bold;
			color: rgba(108, 191, 32, 1);
		}

		span:nth-of-type(1) {
			margin-right: 0.2rem;
		}
	}
</style>
